package com.xiaoshuidi.cloud.module.rooms.controller.app.apartment;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.rooms.controller.app.apartment.vo.ApartmentGuessListResp;
import com.xiaoshuidi.cloud.module.rooms.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.rooms.service.ApartmentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;
import java.util.List;

/**
 * 租客端 - 门店信息
 * @Author Feng
 * @date 2023/7/5
 */
@Tag(name = "租客端 - 门店信息")
@RestController
@RequiredArgsConstructor
@RequestMapping(ApiConstants.NAME + "/apartment")
public class AppApartmentController {
    private final ApartmentService apartmentService;

    /**
     * 猜你喜欢门店列表 - 默认查询最新创建的10条
     *
     * @return
     */
    @Operation(summary = "猜你喜欢门店列表 - 默认查询最新创建的10条")
    @GetMapping("/guess-list")
    @PermitAll
    public CommonResult<List<ApartmentGuessListResp>> guessList() {
        return CommonResult.success(apartmentService.guessList());
    }
}
